package com.wealth.commodity.web.controller;

import iaas.utils.ResultObject;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.wealth.commodity.entity.Search;
import com.wealth.commodity.service.ISearchService;
import com.wealth.system.web.controller.BaseController;



/**
 * 
 * @author Administrator
 */
@Controller
@RequestMapping(value="/search")
public class SearchController extends BaseController{
	
	Logger logger = Logger.getLogger(SearchController.class);
	@Autowired 
	private ISearchService searchService;

	
	@RequestMapping(value = "/searchShow")
	@ResponseBody
	public ResultObject searchShow(HttpServletRequest request, Model model,Long marketId) {
		
		try {
			List<Search> searchs=searchService.findByMarketId(marketId);
			return new ResultObject("000", "查询成功", searchs);
			
		} catch (Exception e) {
			logger.error("查询热搜错误"+e);
			return  new ResultObject("999", "查询错误", "");
		}
	}
	
	
	
		
	
	
}
